package com.attendance.pojo;

import com.attendance.base.BaseEntity;
import com.attendance.security.role.pojo.AbstractRole;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

/**
 * 角色
 *
 * @author 今朝
 * @date 2021/03/14
 */
@Component
@TableName("t_role")
@Data
@EqualsAndHashCode(callSuper = true)
public class Role extends BaseEntity implements AbstractRole {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private String code;
    private Long idx;

    @Override
    public String getRoleCode() {
        return "ROLE_" + this.code;
    }
}
